<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let obj = { name: 'zs', age: 18 }

        // Object.defineProperty(obj, 'age', {
        //     writable: true
        // });

        // obj.age = 9;
        // console.log(obj);
        // configurable：数据是否可删除 可配置
        // let obj = { name: 'zs', age: 18 }
        // Object.defineProperty(obj, 'age', {
        //     configurable: false
        // });
        // delete obj.age


        // console.log(obj);


        //enumerable：属性是否可枚举
        let obj = { name: 'zs', age: 18 }
        //age不可枚举
        Object.defineProperty(obj, 'age', {
            enumerable: false
        });
        for (const key in obj) {
            console.log(obj[key]);
        }


    </script>
</body>

</html>